<!DOCTYPE html > 
<html>
<head> 
<base>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title>批发的查看详情</title>
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all">
  <style>
    body{
    	margin: 10px;
    }
   	.demo-carousel{
   		height: 300px; 
   		line-height: 300px; 
   		text-align: center;
   	}
  </style>
</head>
<body>
	
	<table class="layui-hide" id="goods" lay-filter="demo"></table>


<script src="../../layui/layui.js"></script>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="../../res/mln/getUrlParam.js"></script>
<script>
	var arr = "";
layui.use(['laydate', 'laypage', 'layer', 'table', 'upload', 'element'], function(){
  var laydate = layui.laydate //日期
  ,laypage = layui.laypage //分页
  layer = layui.layer //弹层
  ,table = layui.table //表格
  ,upload = layui.upload //上传
  ,element = layui.element; //元素操作
  
  //监听Tab切换
  element.on('tab(demo)', function(data){
    layer.msg('切换了：'+ this.innerHTML);
    console.log(data);
  });
	//执行一个 table 实例
	  table.render({
	     elem: '#goods'
	    ,url: '../../wholesaleDetail/findByPfIds.action?pfId='+getUrlParam("pfId") //数据接口
	    ,page: true //开启分页
	    ,method:'post'
	    ,size:'sm'
	    ,cols: [[ //表头
	       {type:'checkbox', fixed: 'left'}
	      /* ,{field: 'pfId', title: '批发ID', width:120, fixed: 'left'} */
	      ,{field: 'drugName', title: '药品名称', width:120}
	      ,{field: 'pfxqUnit', title: '单位', width:80}
	      ,{field: 'pfxqNumber', title: '数量', width:90}
	      ,{field: 'pfxqSubtotal', title: '小计', width: 100}
	      ,{field: 'pfxqPrice', title: '批发价', width: 100}
	      ,{field: 'numbers', title: '批次号', width: 120}
	      ,{field: 'ythNumber', title: '已退货数量', width: 120}
	    ]]
	  	,id: 'testReload'
	  });
	//条件查询
	  var $ = layui.$;
			  
	  $('#search').on('click', function(){
		 var matName = $('#drugName');
		 //执行重载
	     table.reload('testReload', {
	       page: {
	         curr: 1 //重新从第 1 页开始
	       }
	       ,where: {
	    	   drugName: matName.val()
	       }
	     });
	  });
});
</script>
</body>
</html>